/**
 * 
 */
package ph.edu.ics.sp.graphisched;

import java.util.ArrayList;

/**
 * @author Kathrynne Joy M. De Leon
 * 
 */
public class Course {
	private String courseCode;
	private String courseTitle;
	private int units;
	private String semesterOffered;
	private int hasLaboratory;
	private String prerequisite;
	private int lectureHoursPerWeek;
	private int lecSessionsPerWeek;
	private int laboratoryHoursPerWeek;
	private int laboratorySessionsPerWeek;
	private String category;

	/**
	 * default constructor
	 */
	public Course() {
		super();
		// TODO Auto-generated constructor stub
	}

	/**
	 * @param courseCode
	 * @param courseTitle
	 * @param units
	 * @param semesterOffered
	 * @param hasLaboratory
	 * @param prerequisite
	 * @param lectureHoursPerWeek
	 * @param lecSessionsPerWeek
	 * @param laboratoryHoursPerWeek
	 * @param laboratorySessionsPerWeek
	 */
	public Course(String courseCode, String courseTitle, int units,
			String semesterOffered, int hasLaboratory, String prerequisite,
			int lectureHoursPerWeek, int lecSessionsPerWeek,
			int laboratoryHoursPerWeek, int laboratorySessionsPerWeek,
			String category) {
		super();
		this.courseCode = courseCode;
		this.courseTitle = courseTitle;
		this.units = units;
		this.semesterOffered = semesterOffered;
		this.hasLaboratory = hasLaboratory;
		this.prerequisite = prerequisite;
		this.lectureHoursPerWeek = lectureHoursPerWeek;
		this.lecSessionsPerWeek = lecSessionsPerWeek;
		this.laboratoryHoursPerWeek = laboratoryHoursPerWeek;
		this.laboratorySessionsPerWeek = laboratorySessionsPerWeek;
		this.category = category;
	}

	/**
	 * @return the courseCode
	 */
	public String getCourseCode() {
		return courseCode;
	}

	/**
	 * @param courseCode
	 *            the courseCode to set
	 */
	public void setCourseCode(String courseCode) {
		this.courseCode = courseCode;
	}

	/**
	 * @return the courseTitle
	 */
	public String getCourseTitle() {
		return courseTitle;
	}

	/**
	 * @param courseTitle
	 *            the courseTitle to set
	 */
	public void setCourseTitle(String courseTitle) {
		this.courseTitle = courseTitle;
	}

	/**
	 * @return the units
	 */
	public int getUnits() {
		return units;
	}

	/**
	 * @param units
	 *            the units to set
	 */
	public void setUnits(int units) {
		this.units = units;
	}

	/**
	 * @return the semesterOffered
	 */
	public String getSemesterOffered() {
		return semesterOffered;
	}

	/**
	 * @param semesterOffered
	 *            the semesterOffered to set
	 */
	public void setSemesterOffered(String semesterOffered) {
		this.semesterOffered = semesterOffered;
	}

	/**
	 * @return the hasLaboratory
	 */
	public int getHasLaboratory() {
		return hasLaboratory;
	}

	/**
	 * @param hasLaboratory
	 *            the hasLaboratory to set
	 */
	public void setHasLaboratory(int hasLaboratory) {
		this.hasLaboratory = hasLaboratory;
	}

	/**
	 * @return the prerequisite
	 */
	public String getPrerequisite() {
		return prerequisite;
	}

	/**
	 * @param prerequisite
	 *            the prerequisite to set
	 */
	public void setPrerequisite(String prerequisite) {
		this.prerequisite = prerequisite;
	}

	/**
	 * @return the lectureHoursPerWeek
	 */
	public int getLectureHoursPerWeek() {
		return lectureHoursPerWeek;
	}

	/**
	 * @param lectureHoursPerWeek
	 *            the lectureHoursPerWeek to set
	 */
	public void setLectureHoursPerWeek(int lectureHoursPerWeek) {
		this.lectureHoursPerWeek = lectureHoursPerWeek;
	}

	/**
	 * @return the lecSessionsPerWeek
	 */
	public int getLecSessionsPerWeek() {
		return lecSessionsPerWeek;
	}

	/**
	 * @param lecSessionsPerWeek
	 *            the lecSessionsPerWeek to set
	 */
	public void setLecSessionsPerWeek(int lecSessionsPerWeek) {
		this.lecSessionsPerWeek = lecSessionsPerWeek;
	}

	/**
	 * @return the laboratoryHoursPerWeek
	 */
	public int getLaboratoryHoursPerWeek() {
		return laboratoryHoursPerWeek;
	}

	/**
	 * @param laboratoryHoursPerWeek
	 *            the laboratoryHoursPerWeek to set
	 */
	public void setLaboratoryHoursPerWeek(int laboratoryHoursPerWeek) {
		this.laboratoryHoursPerWeek = laboratoryHoursPerWeek;
	}

	/**
	 * @return the laboratorySessionsPerWeek
	 */
	public int getLaboratorySessionsPerWeek() {
		return laboratorySessionsPerWeek;
	}

	/**
	 * @param laboratorySessionsPerWeek
	 *            the laboratorySessionsPerWeek to set
	 */
	public void setLaboratorySessionsPerWeek(int laboratorySessionsPerWeek) {
		this.laboratorySessionsPerWeek = laboratorySessionsPerWeek;
	}

	/*
	 * (non-Javadoc)
	 * 
	 * @see java.lang.Object#toString()
	 */
	public String toString() {
		// TODO: returns a string representation of this object
		return null;
	}

	/**
	 * @return the category
	 */
	public String getCategory() {
		return category;
	}

	/**
	 * @param category
	 *            the category to set
	 */
	public void setCategory(String category) {
		this.category = category;
	}

	public int getCourseIndex(ArrayList<Course> courses, String courseCode) {
		int index = -1;

		int size = courses.size();
		for (int i = 0; i < size; i++) {
			if (courses.get(i).getCourseCode().equals(courseCode)) {
				index = i;
				break;
			}
		}

		return index;
	}

}
